#include <string.h>
#include <iostream>
#include "trace.h"

using namespace std;

Trace::Trace(Trace_Type type, void *param, uint8_t len)
{
    cout<<"Trace"<<endl;

    double *tmp = (double *)param;
    len = ((len > TRACE_PARAM_MAX)?TRACE_PARAM_MAX:len);
    if(TRACE_CYCLOID == type) {
        if(len != (sizeof(Trace_Cycloid_Param)/sizeof(double))) {
            cout << "TRACE_CYCLOID param len error!" << endl;
            return ;
        }
        for(uint8_t i = 0; i < len; i++) {
            this->param[i] = tmp[i];
        }
    } else {
        ;
    }
}

Trace::~Trace()
{
    std::cout<<"~Trace"<<std::endl;
}
